import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const Login = () => import('./views/login/login.vue')
const Home = () => import('./views/home/home.vue')
const Setup = () => import('./views/setup/setup.vue')
const ConfigManage = () => import('./views/setup/configManage.vue')
const MyCoupon = () => import('./views/myCoupon/myCoupon.vue')
const CouponDetail = () => import('./views/myCoupon/myCouponDetail.vue')
const ResetPwd = () => import('./views/setup/resetPwd.vue')
const GrantCoupon = () => import('./views/grant/grantCoupon.vue')
const SoftDisk = () => import('./views/myCoupon/softDisk.vue')
const GrantRecord = () => import('./views/myCoupon/grantRecord.vue')
const GrantAuthority = () => import('./views/setup/grantAuthority.vue')
const AddGrant = () => import('./views/setup/addGrant.vue')
const BuyCoupon = () => import('./views/buyCoupon/couponList.vue')
const WriteOrder = () => import('./views/buyCoupon/writeOrder.vue')
const TradeRecord = () => import('./views/tradeRecord/tradeRecord.vue')
const CouponReport = () => import('./views/couponReport/couponReport.vue')

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    { //登录
      path: '/',
      name: 'login',
      component: Login
    },
    { //首页
      path: '/home',
      name: 'home',
      component: Home
    },
    { //设置
      path: '/setup',
      name: 'setup',
      component: Setup
    },
    { //设置--配置管理
      path: '/configManage',
      name: 'configManage',
      component: ConfigManage
    },
    { //设置--重置密码
      path: '/resetPwd',
      name: 'resetPwd',
      component: ResetPwd
    },
    { //我的优惠券
      path: '/myCoupon', 
      name: 'myCoupon',
      component: MyCoupon
    },
    { //优惠券详情
      path: '/myCouponDetail',
      name: 'myCouponDetail',
      component: CouponDetail
    },
    { //发放优惠券
      path: '/grantCoupon',
      name: 'grantCoupon',
      component: GrantCoupon
    },
    { //软盘--填写车牌
      path: '/softDisk',
      name: 'softDisk',
      component: SoftDisk
    },
    { //发放记录
      path: '/grantRecord',
      name: 'grantRecord',
      component: GrantRecord
    },
    { //发放授权
      path: '/grantAuthority',
      name: 'grantAuthority',
      component: GrantAuthority
    },
    { //添加发放员
      path: '/addGrant',
      name: 'addGrant',
      component: AddGrant
    },
    { //购买优惠券
      path: '/buyCoupon',
      name: 'buyCoupon',
      component: BuyCoupon
    },
    { //购买优惠券--确认信息
      path: '/writeOrder',
      name: 'writeOrder',
      component: WriteOrder
    },
    { //交易流水
      path: '/tradeRecord',
      name: 'tradeRecord',
      component: TradeRecord
    },
    { //券报表
      path: '/couponReport',
      name: 'couponReport',
      component: CouponReport
    }
  ]
})
